﻿using Castle.DynamicProxy;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace EquipmentModule
{
    public class DBInterceptor : IInterceptor
    {
        public void Intercept(IInvocation invocation)
        {
            Console.WriteLine("拦截器begin");
            var inheritIRequestParameters = invocation.Arguments.Where(p=>p.GetType()==typeof(string));
            foreach (var requestParameter in inheritIRequestParameters)
            {
                Console.WriteLine(requestParameter);
                //((IRequest)requestParameter).User = new User { Name = "myhub" };
            }
            invocation.Proceed();
            Console.WriteLine("拦截器end");
        }
    }
}
